using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using AppEnvironment.Lib;
using AppEnvironment.Lib.Interfaces;

namespace AppEnvironment.Web
{
    internal class WebApplication : IStateHolder
    {
        public WebApplication(HttpApplicationState application)
        {
            Application = application;
        }

        private HttpApplicationState mApplication;
        private HttpApplicationState Application
        {
            get { return mApplication; }
            set { mApplication = value; }
        }
	

        #region IStateHolder Members

        public object this[string key]
        {
            get
            {
                if (Application == null)
                {
                    return null;
                }
                return Application[key];
            }
            set
            {
                if (Application == null)
                {
                    throw new Exception("Application state object is null at this time");
                }
                Application[key] = value;
            }
        }

        #endregion
    }
}
